package com.cy.law.db.entity;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Objects;

@Entity
@Table(name = "nav_item", schema = "zhifayi", catalog = "")
public class NavItem implements Serializable {
    private Integer navId;
    private String navNameEng;
    private String navNameCh;
    private String navIcon;
    private Integer groupId;
    private Integer seniorId;
    private String url;
    private Integer displayOrder;
    private Integer available;
    private Integer isLeaf;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "nav_id")
    public Integer getNavId() {
        return navId;
    }

    public void setNavId(Integer navId) {
        this.navId = navId;
    }

    @Basic
    @Column(name = "nav_name_eng")
    public String getNavNameEng() {
        return navNameEng;
    }

    public void setNavNameEng(String navNameEng) {
        this.navNameEng = navNameEng;
    }

    @Basic
    @Column(name = "nav_name_ch")
    public String getNavNameCh() {
        return navNameCh;
    }

    public void setNavNameCh(String navNameCh) {
        this.navNameCh = navNameCh;
    }

    @Basic
    @Column(name = "nav_icon")
    public String getNavIcon() {
        return navIcon;
    }

    public void setNavIcon(String navIcon) {
        this.navIcon = navIcon;
    }

    @Basic
    @Column(name = "group_id")
    public Integer getGroupId() {
        return groupId;
    }

    public void setGroupId(Integer groupId) {
        this.groupId = groupId;
    }

    @Basic
    @Column(name = "senior_id")
    public Integer getSeniorId() {
        return seniorId;
    }

    public void setSeniorId(Integer seniorId) {
        this.seniorId = seniorId;
    }

    @Basic
    @Column(name = "url")
    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    @Basic
    @Column(name = "display_order")
    public Integer getDisplayOrder() {
        return displayOrder;
    }

    public void setDisplayOrder(Integer displayOrder) {
        this.displayOrder = displayOrder;
    }

    @Basic
    @Column(name = "available")
    public Integer getAvailable() {
        return available;
    }

    public void setAvailable(Integer available) {
        this.available = available;
    }

    @Basic
    @Column(name = "is_leaf")
    public Integer getIsLeaf() {
        return isLeaf;
    }

    public void setIsLeaf(Integer isLeaf) {
        this.isLeaf = isLeaf;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        NavItem navItem = (NavItem) o;
        return navId == navItem.navId &&
                isLeaf == navItem.isLeaf &&
                Objects.equals(navNameEng, navItem.navNameEng) &&
                Objects.equals(navNameCh, navItem.navNameCh) &&
                Objects.equals(navIcon, navItem.navIcon) &&
                Objects.equals(groupId, navItem.groupId) &&
                Objects.equals(seniorId, navItem.seniorId) &&
                Objects.equals(url, navItem.url) &&
                Objects.equals(displayOrder, navItem.displayOrder) &&
                Objects.equals(available, navItem.available);
    }

    @Override
    public int hashCode() {
        return Objects.hash(navId, navNameEng, navNameCh, navIcon, groupId, seniorId, url, displayOrder, available, isLeaf);
    }
}
